package fifth.service.impl;



import fifth.dao.StudentDao;
import fifth.dao.impl.StudentDaoImpl;
import fifth.domain.PageBean;
import fifth.domain.Student;
import fifth.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    @Override
    public PageBean<Student> findByPage(Integer pageNum, Integer pageSize) {
        StudentDao studentDao=new StudentDaoImpl();
        List<Student> data = studentDao.findByPage(pageNum, pageSize);
        long totalSize = studentDao.getCount();
        PageBean<Student> pageBean=new PageBean<>(pageNum, pageSize, totalSize, data);
        return pageBean;
    }
}
